package com.aiyige.page.publish.tag.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.publish.tag.model.TagItem;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2017/11/13.
 */

public class TagAdapter extends BaseQuickAdapter<TagItem, TagAdapter.ViewHolder> {


    public TagAdapter() {
        super(R.layout.tag_item, new LinkedList<TagItem>());
    }

    @Override
    protected void convert(ViewHolder helper, TagItem item) {
        helper.bindData(item);
    }


    public class ViewHolder extends BaseViewHolder {
        @BindView(R.id.itemTv)
        TextView itemTv;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(TagItem data) {
            itemTv.setText("#" + data.getName());
        }
    }

}
